01บทนำ · About This Guide
Test scope · deliverables · references
เอกสารนี้เป็น Test Documentation ครบวงจรสำหรับหน้าจอ CreateProject Web v14.0 ประกอบด้วย:
- Test Scenarios · 12 test areas · ครอบคลุมทุก workflow ของ 5-step wizard
- Test Cases · 55+ cases · Positive / Negative / Boundary / UI / Accessibility
- Playwright Automation Guide · Setup · Page Object Model · Sample scripts
- AI Testing Tools Comparison · เปรียบเทียบเครื่องมือ AI testing ปี 2025 · แนะนำที่ดีที่สุด
📌
Reference file:
ConstructQ_CreateProject_v14.0.html · React SPA · 5-step wizard · bilingual TH/EN · List + Form views · Confirm popup on save02Overview หน้าจอ · Screen Structure
2 main views + 5-step wizard + confirm popups
🗺️ Screen Map
| View | Route | Function |
|---|---|---|
| Project List | /project/setup (view=list) | Table + cards ของโครงการทั้งหมด · summary stats · New/Edit/Delete |
| Create Form | view=form · editingId=null | 5-step wizard · Left stepper + Right main content |
| Edit Form | view=form · editingId=P-001 | เหมือน create form · pre-filled data · button "บันทึกการแก้ไข" |
| Save Confirm Modal | saveConfirm !== null | Summary card + Confirm/Cancel |
| Delete Confirm Modal | delConfirm !== null | Warning + Confirm/Cancel |
| WBS Template Picker Modal | เลือกจาก 8 standard templates | Grid + recommended tag |
📋 5-Step Wizard
| # | Step Title | Key Fields | Business Rules |
|---|---|---|---|
| 01 | ข้อมูลโครงการ · Project Details | code (auto/manual) · name · type · client · value · start · end · duration · desc | Required: name, type, client, start, end · Duration = end-start · start < end |
| 02 | ไซต์ / โซน · Sites/Zones | Site (name, code, address) → Zone (code, area) → Floor → Room | Address auto-fill (tambon → district/province/postal) · nested hierarchy |
| 03 | สมาชิก · Members | name · email · role · phone | Roles: PM · QCM · Inspector · Fixer · Executive · email format |
| 04 | ไฟล์แบบโครงการ · Files | fileName · fileType · version · uploadBy | Types: Drawing, Spec, Contract, BOQ, Other · uploadBy = ต้องเป็นสมาชิก |
| 05 | WBS · Work Breakdown | 3 modes: template · manual · import | Template = ใช้จาก 8 standard · Import = .xlsx with WBS-L1/L2/L3 columns |
🎨 UI Components
- AppShell · Sidebar + Topbar + Breadcrumb · Language toggle · User profile
- Cp Back Button · Circular ← ก่อน title (v13.0+)
- Cp Stepper · Left vertical · click-to-jump navigation
- Cp Save Confirm · Summary popup (v14.0)
- Toast Notifications · Success · Error
03Test Strategy
Test types · priority · environment · risk-based approach
🎯 Test Types Covered
| Test Type | Objective | Coverage |
|---|---|---|
| Positive | ทำงานตาม happy path | ~50% |
| Negative | error/invalid input · empty · duplicate | ~25% |
| Boundary | ค่าขอบ · min/max · empty vs 1 vs many | ~10% |
| UI/UX | Layout · responsive · animation | ~10% |
| Accessibility | Keyboard nav · ARIA · contrast · screen reader | ~5% |
⚡ Priority Levels
| Priority | Criteria | Execution |
|---|---|---|
| P1 · Critical | Blocker · ห้ามผ่านถ้าไม่ผ่าน · เกี่ยวกับ data integrity/save | ทุก build |
| P2 · High | Feature หลัก · ผลกระทบต่อ UX | ทุก sprint |
| P3 · Medium | Enhancement · edge case | Full regression |
🌐 Test Environments
- Local Dev: Chrome + Firefox · manual testing สำหรับ dev
- Staging: Chrome + Firefox + Safari + Edge · Playwright automated · nightly runs
- UAT: Real users + accessibility tools · Weekly
- Production: Smoke tests only · post-deploy
04Test Scenarios + Test Cases
12 areas · 55+ detailed test cases
4.1 · 📋 Project List View
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-01 | เข้าหน้า Project List | 1. Login 2. Navigate to /project/setup |
แสดง breadcrumb · summary stats · list ของโครงการ (cards หรือ table) | P1 | Pos |
| TC-02 | Summary stats แสดงถูกต้อง | 1. เข้าหน้า List | แสดง: จำนวนโครงการทั้งหมด · ดำเนินการอยู่ · เสร็จสิ้น · มูลค่ารวม | P2 | Pos |
| TC-03 | Empty state (ไม่มีโครงการ) | 1. เริ่ม tenant ใหม่ที่ไม่มี project | แสดง empty state message + CTA "สร้างโครงการใหม่" | P2 | UI |
| TC-04 | คลิก card เข้า Edit form | 1. คลิกที่ card ของ project P-001 | เข้า view=form · editingId=P-001 · pre-filled data | P1 | Pos |
| TC-05 | ปุ่ม "สร้างโครงการใหม่" | 1. กดปุ่มสร้างโครงการใหม่ | เข้า view=form · editingId=null · form ว่าง · aria current step=1 | P1 | Pos |
4.2 · 📝 Step 01 · Project Details
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-06 | Auto code toggle default | 1. เข้า Create form · Step 01 | รหัสโครงการ default เป็น "อัตโนมัติ" (readonly) · แสดงตัวอย่าง P-YYYY-### | P2 | Pos |
| TC-07 | Manual code toggle · ใส่ค่าได้ | 1. Toggle เป็น "กำหนดเอง" 2. พิมพ์ "P-CUSTOM-001" |
Field เปิด editable · รับค่า custom · toggle กลับ auto = clear | P2 | Pos |
| TC-08 | Required · name เว้นว่าง | 1. ทิ้ง name ว่าง 2. กดถัดไป |
Error message ใต้ field · block navigation · aria-invalid | P1 | Neg |
| TC-09 | Project type dropdown · 9 options | 1. เปิด dropdown type | แสดง 9 options (อาคารสำนักงาน · พักอาศัย · โครงสร้างพื้นฐาน · Renovation · โรงงาน · Data Center · โซล่าเซลล์ · EV Charger · โรงพยาบาล) | P2 | Pos |
| TC-10 | Value (บาท) · รับตัวเลข format ถูก | 1. พิมพ์ "50000000" | แสดง "50,000,000 บาท" · thousand separator · reject alpha | P2 | Pos |
| TC-11 | Value · reject negative | 1. พิมพ์ "-100000" | Error "มูลค่าต้องเป็นบวก" · block save | P2 | Neg |
| TC-12 | Date range · start > end | 1. ตั้ง start = 2027-01-01 2. ตั้ง end = 2026-01-01 |
Error "วันเริ่มต้องมาก่อนวันสิ้นสุด" · durationErr | P1 | Neg |
| TC-13 | Duration auto-calc | 1. ตั้ง start = 2026-01-01 2. ตั้ง end = 2026-12-31 |
Duration แสดง "รวมระยะเวลา 364 วัน (12.1 เดือน)" | P2 | Pos |
| TC-14 | Description · optional | 1. ปล่อย description ว่าง 2. Next |
ไม่มี error · ผ่านไป Step 02 | P3 | Pos |
4.3 · 🏗️ Step 02 · Sites/Zones
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-15 | Empty state · ยังไม่มีไซต์ | 1. เข้า Step 02 ใหม่ | แสดง 'ยังไม่มีไซต์งาน — กด "เพิ่มไซต์" เพื่อเริ่ม' + CTA | P2 | UI |
| TC-16 | เพิ่ม Site | 1. กด "เพิ่มไซต์" 2. กรอก siteName + siteCode |
Site ถูกเพิ่ม · แสดง card ที่มี actions (edit/duplicate/delete/collapse) | P1 | Pos |
| TC-17 | Address auto-fill · tambon | 1. พิมพ์ "ห้วยขวาง" ใน address sub | Autocomplete แสดง options · เลือกแล้วเติมอำเภอ/จังหวัด/รหัสไปรษณีย์อัตโนมัติ | P1 | Pos |
| TC-18 | Address · empty state | 1. พิมพ์ "xxxxx" | แสดง "ไม่พบ — ลองพิมพ์คำอื่น" | P3 | Neg |
| TC-19 | เพิ่ม Zone ในไซต์ | 1. ใน Site card · กด "เพิ่มโซน" 2. กรอก zoneCode, zoneName, zoneArea |
Zone ถูกเพิ่มใต้ Site · nested hierarchy · sum แสดงในสรุป | P1 | Pos |
| TC-20 | เพิ่ม Floor + Room | 1. ใน Zone · กด "เพิ่มชั้น" 2. กด "เพิ่มห้อง" |
Nested 4 ระดับ (Site → Zone → Floor → Room) · แต่ละระดับมี code/name | P2 | Pos |
| TC-21 | Duplicate Site | 1. กด duplicate icon บน Site card | สำเนา Site (พร้อม zones/floors/rooms) · ชื่อ "...(สำเนา)" | P3 | Pos |
| TC-22 | Collapse/Expand Site | 1. กด "ย่อ" / "ขยาย" | Zones ถูกซ่อน/แสดง · smooth animation · state persist | P3 | UI |
4.4 · 👥 Step 03 · Members
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-23 | Empty state | 1. เข้า Step 03 ใหม่ | 'ยังไม่มีสมาชิก — กด "เพิ่มรายการ" เพื่อเริ่ม' | P3 | UI |
| TC-24 | เพิ่มสมาชิก · valid data | 1. name = "สมชาย" 2. email = "somchai@test.com" 3. role = "ผู้จัดการโครงการ" 4. phone = "0812345678" |
Member ถูกเพิ่ม · row แสดงข้อมูล + delete action | P1 | Pos |
| TC-25 | Email format · invalid | 1. email = "not-an-email" | Error "รูปแบบอีเมลไม่ถูกต้อง" · aria-invalid | P1 | Neg |
| TC-26 | Role dropdown · 5 options | 1. เปิด role dropdown | 5 options (PM · QCM · Inspector · Fixer · Executive) | P2 | Pos |
| TC-27 | Phone · non-numeric | 1. phone = "abc123" | Error หรือ reject alpha · แสดง hint format | P2 | Neg |
| TC-28 | Duplicate email · 2 members | 1. เพิ่ม 2 members ที่มี email เดียวกัน | Warning "อีเมลนี้ถูกใช้แล้ว" หรือ block · ตามที่ business rule กำหนด | P2 | Neg |
4.5 · 📎 Step 04 · Files
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-29 | Empty state + no members hint | 1. เข้า Step 04 (Step 03 ว่าง) | 'ยังไม่มีไฟล์' + hint "(ต้องเพิ่มสมาชิกใน Timeline 03 ก่อน)" | P2 | UI |
| TC-30 | เพิ่มไฟล์ · valid | 1. fileName = "แบบ-STR-01.pdf" 2. fileType = "Drawing" 3. version = "1.0" 4. uploadBy = "สมชาย" |
File added · แสดง row | P1 | Pos |
| TC-31 | File type dropdown · 5 options | 1. เปิด fileType dropdown | 5 options (Drawing · Specification · Contract · BOQ · Other) | P2 | Pos |
| TC-32 | uploadBy = สมาชิก · picker | 1. คลิก uploadBy field | Dropdown แสดงเฉพาะสมาชิกที่มีใน Step 03 · เลือกได้ | P2 | Pos |
4.6 · 🏗️ Step 05 · WBS
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-33 | Mode selection · 3 modes | 1. เข้า Step 05 (new project) | แสดง 3 mode cards (Template / Manual / Import) + "แนะนำ" tag บน mode ที่เหมาะ | P1 | Pos |
| TC-34 | Template mode · เลือก template | 1. เลือก mode "ใช้เทมเพลทมาตรฐาน" 2. คลิก card ของ template |
Modal picker เปิด · แสดง 8 templates · เลือก 1 ↦ apply | P1 | Pos |
| TC-35 | Template applied · แสดง WBS rows | 1. เลือก template "คอนโด v1.1" | Toast "ใช้เทมเพลท ... เรียบร้อย — {count} รายการ" · WBS tree แสดง L1/L2/L3 | P1 | Pos |
| TC-36 | Manual mode · เพิ่ม row | 1. เลือก "กรอกเอง" 2. เพิ่ม L1 row |
เปิดตารางว่าง · เพิ่ม row · แก้ inline · code, name, level, refStd, risk, HW | P1 | Pos |
| TC-37 | Import mode · valid Excel | 1. เลือก Import 2. Upload .xlsx ที่มี WBS-L1/L2/L3 columns |
Preview modal แสดง rows · confirm ↦ import | P2 | Pos |
| TC-38 | Import · invalid format | 1. Upload .xlsx ที่ไม่มี columns ถูกต้อง | Error "รูปแบบไฟล์ไม่ถูกต้อง" · block import | P2 | Neg |
| TC-39 | เปลี่ยน mode ระหว่างใช้งาน | 1. Template mode มี data 2. กด "เปลี่ยนวิธี" |
Warning "จะสูญเสียข้อมูลเดิม" · ยืนยัน ↦ clear + switch | P2 | Neg |
4.7 · 💾 Save Confirm Popup (v14.0)
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-40 | Create mode · confirm popup summary | 1. กรอก 5 steps 2. กด "สร้างโครงการ" |
Popup summary แสดง: code, name, type, client, value, timeline, จำนวน sites/zones/members/files/WBS · icon 🚀 · title "ยืนยันการสร้างโครงการ" | P1 | Pos |
| TC-41 | Edit mode · confirm popup title | 1. Edit existing project 2. กด "บันทึกการแก้ไข" |
Popup title = "ยืนยันการแก้ไข" · icon 💾 (สีฟ้า) · summary เดียวกัน | P1 | Pos |
| TC-42 | Cancel · ปิด popup · ไม่บันทึก | 1. เปิด confirm 2. กด "ยกเลิก" |
Popup ปิด · กลับไปฟอร์ม · data ยังอยู่ · ไม่ save | P1 | Pos |
| TC-43 | Confirm · save + toast + back to list | 1. เปิด confirm 2. กด "ยืนยัน" |
บันทึก · toast success · redirect กลับ list view | P1 | Pos |
| TC-44 | Summary stats ตรงกับข้อมูลจริง | 1. มี 2 sites (5 zones · 8 files · 6 members · 45 WBS rows) 2. เปิด confirm popup |
Stats แสดง 2 · 5 · 6 · 8 · 45 ตรงตามข้อมูลจริง | P2 | Bnd |
4.8 · ✏️ Edit Mode
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-45 | Load existing · all data prefilled | 1. คลิก card ของ P-001 | All 5 steps มีข้อมูล · code, sites, members, files, WBS ครบ · title "← แก้ไขโครงการ" | P1 | Pos |
| TC-46 | Edit + Save · data ถูก update | 1. เปลี่ยน name 2. บันทึก + confirm |
List view แสดง name ใหม่ · updatedAt เปลี่ยน | P1 | Pos |
| TC-47 | Back button · unsaved changes warning | 1. Edit + เปลี่ยน field 2. กด back (←) |
Warning "มีการแก้ไข ยังไม่บันทึก" · confirm ↦ back · cancel ↦ อยู่ต่อ | P2 | Neg |
4.9 · 🗑️ Delete Project
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-48 | Delete · confirm modal | 1. คลิก delete บน P-001 | Modal แสดง warning "ข้อมูลทั้งหมด (Zone, สมาชิก, ไฟล์, WBS) จะถูกลบ" · [ยกเลิก][ยืนยันลบ] | P1 | Pos |
| TC-49 | Cancel delete | 1. เปิด delete modal 2. กด "ยกเลิก" |
Modal ปิด · project ยังอยู่ | P1 | Pos |
| TC-50 | Confirm delete · removed from list | 1. Confirm delete | Project หายจาก list · toast success · summary stats update | P1 | Pos |
4.10 · 🌐 Language Toggle
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-51 | TH → EN · all UI updated | 1. TH mode 2. คลิก EN flag |
All labels · buttons · headers · stepper · error messages เปลี่ยนเป็น EN | P1 | Pos |
| TC-52 | Preserve data on language switch | 1. กรอกข้อมูล 2. Toggle EN 3. Toggle TH |
Data ทั้งหมดยังอยู่ · ไม่หาย | P1 | Pos |
4.11 · 📊 Excel Export/Import
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-53 | Export project · valid xlsx | 1. Edit project 2. กด Export |
Download .xlsx มี 5 sheets (Project · Sites · Members · Files · WBS) | P2 | Pos |
| TC-54 | Import blank · new project | 1. Import empty template | Preview empty rows · confirm ↦ new project blank | P3 | Pos |
4.12 · ♿ Accessibility
| TC ID | Scenario | Steps | Expected Result | Priority | Type |
|---|---|---|---|---|---|
| TC-55 | Keyboard navigation · full flow | 1. Tab จาก field แรก · ผ่านทุก step ด้วย Tab + Enter | โฟกัสเห็นชัด · ไม่ trap · Enter บนปุ่ม = submit | P2 | A11y |
| TC-56 | Screen reader · aria labels | 1. เปิด NVDA/VoiceOver · scan form | ทุก input มี aria-label · ปุ่มมี text · error announced | P2 | A11y |
| TC-57 | Color contrast · WCAG AA | 1. Run axe-core scan | All text/bg contrast ≥ 4.5:1 (AA) | P2 | A11y |
📊
Test Case สรุป: รวมทั้งหมด 57 test cases · P1 = 22 · P2 = 25 · P3 = 10 · Positive 32 · Negative 12 · Boundary 4 · UI 6 · Accessibility 3
05Playwright Automation Guide
Setup · Page Object Model · Sample code · CI/CD
🚀 Setup
- Install:
npm init playwright@latest· เลือก TypeScript · Chromium+Firefox+WebKit - Structure: สร้างโฟลเดอร์ ·
tests/,pages/,fixtures/,data/ - Config: แก้
playwright.config.ts· baseURL, retries, screenshot on failure, trace on retry - CI: เพิ่ม GitHub Action workflow · run tests on PR + nightly
- Report: เปิด HTML report ด้วย
npx playwright show-report
📁 Recommended Project Structure
treetests/ ├── create-project/ │ ├── list.spec.ts │ ├── step01-project.spec.ts │ ├── step02-sites.spec.ts │ ├── step03-members.spec.ts │ ├── step04-files.spec.ts │ ├── step05-wbs.spec.ts │ ├── save-confirm.spec.ts │ └── e2e-full-flow.spec.ts pages/ ├── CreateProjectPage.ts # Page Object Model ├── ProjectListPage.ts └── SaveConfirmModal.ts fixtures/ ├── auth.ts # Login fixture └── test-data.ts # Sample project data data/ ├── projects.json └── wbs-templates.xlsx playwright.config.ts
🎯 Page Object Model · CreateProjectPage.ts
TypeScriptimport { Page, Locator, expect } from '@playwright/test'; export class CreateProjectPage { readonly page: Page; readonly stepperItems: Locator; readonly btnNext: Locator; readonly btnBack: Locator; readonly btnCreate: Locator; readonly btnSave: Locator; constructor(page: Page) { this.page = page; this.stepperItems = page.locator('.cp-stepper .cp-step'); this.btnNext = page.getByRole('button', { name: /ถัดไป|Next/ }); this.btnBack = page.getByRole('button', { name: /ย้อนกลับ|Back/ }); this.btnCreate = page.getByRole('button', { name: /สร้างโครงการ|Create Project/ }); this.btnSave = page.getByRole('button', { name: /บันทึกการแก้ไข|Save Changes/ }); } // Step 01 · Project Details async fillStep01(data: { codeMode?: 'auto' | 'manual'; code?: string; name: string; type: string; client: string; value: number; startDate: string; endDate: string; description?: string; }) { const p = this.page; if (data.codeMode === 'manual') { await p.getByLabel('กำหนดเอง').click(); await p.getByLabel(/รหัสโครงการ/).fill(data.code ?? ''); } await p.getByLabel(/^ชื่อโครงการ/).fill(data.name); await p.getByLabel(/ประเภทโครงการ/).selectOption(data.type); await p.getByLabel(/เจ้าของโครงการ/).fill(data.client); await p.getByLabel(/มูลค่า/).fill(String(data.value)); await p.getByLabel(/วันที่เริ่ม/).fill(data.startDate); await p.getByLabel(/วันที่สิ้นสุด/).fill(data.endDate); if (data.description) { await p.getByLabel(/รายละเอียด/).fill(data.description); } } // Step 02 · Add Site async addSite(site: { name: string; code: string; }) { await this.page.getByRole('button', { name: /เพิ่มไซต์/ }).click(); const lastCard = this.page.locator('.cp-site-card').last(); await lastCard.getByLabel(/ชื่อไซต์งาน/).fill(site.name); await lastCard.getByLabel(/รหัสไซต์/).fill(site.code); } async gotoStep(stepNum: number) { await this.stepperItems.nth(stepNum - 1).click(); } async submitCreate() { await this.btnCreate.click(); // Wait for confirm popup await this.page.getByRole('dialog').waitFor({ state: 'visible' }); } }
✅ Sample Test · E2E Full Flow
TypeScriptimport { test, expect } from '@playwright/test'; import { CreateProjectPage } from '../pages/CreateProjectPage'; test.describe('CreateProject · E2E', () => { test.beforeEach(async ({ page }) => { await page.goto('/project/setup'); await page.getByRole('button', { name: /สร้างโครงการใหม่/ }).click(); }); test('TC-40 · Create project · complete 5-step wizard', async ({ page }) => { const cp = new CreateProjectPage(page); // Step 01 await cp.fillStep01({ name: 'Tarnas Tower Phase 2', type: 'อาคารสำนักงาน', client: 'บ.ธาร์ณัส จำกัด', value: 820000000, startDate: '2026-08-01', endDate: '2028-12-31', }); await cp.gotoStep(2); // Step 02 · Sites await cp.addSite({ name: 'อาคาร A', code: 'S-01' }); await cp.addSite({ name: 'อาคาร B', code: 'S-02' }); await cp.gotoStep(5); // Skip to submit await cp.submitCreate(); // Verify Confirm Popup const dialog = page.getByRole('dialog'); await expect(dialog).toContainText('ยืนยันการสร้างโครงการ'); await expect(dialog).toContainText('Tarnas Tower Phase 2'); await expect(dialog).toContainText('2 ไซต์'); // Confirm await dialog.getByRole('button', { name: /ยืนยัน/ }).click(); // Verify redirect + toast await expect(page.getByRole('status')).toContainText(/สร้างโครงการ.*เรียบร้อย/); await expect(page).toHaveURL(/project\/setup$/); }); test('TC-12 · Date validation · start > end shows error', async ({ page }) => { const cp = new CreateProjectPage(page); await page.getByLabel(/วันที่เริ่ม/).fill('2027-01-01'); await page.getByLabel(/วันที่สิ้นสุด/).fill('2026-01-01'); await expect(page.getByText('วันเริ่มต้องมาก่อนวันสิ้นสุด')).toBeVisible(); }); test('TC-51 · Language toggle · TH → EN', async ({ page }) => { await expect(page.getByText('ข้อมูลโครงการ')).toBeVisible(); await page.getByRole('button', { name: /English/ }).click(); await expect(page.getByText('Project Details')).toBeVisible(); }); });
⚙️ playwright.config.ts
TypeScriptimport { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './tests', fullyParallel: true, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 2 : undefined, reporter: [['html'], ['list'], ['junit', { outputFile: 'results.xml' }]], use: { baseURL: process.env.BASE_URL ?? 'http://localhost:3000', trace: 'on-first-retry', screenshot: 'only-on-failure', video: 'retain-on-failure', locale: 'th-TH', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, { name: 'firefox', use: { ...devices['Desktop Firefox'] } }, { name: 'webkit', use: { ...devices['Desktop Safari'] } }, { name: 'mobile-chrome', use: { ...devices['Pixel 5'] } }, ], });
💡
Best Practices: ใช้
getByRole, getByLabel · หลีกเลี่ยง CSS selectors ตายตัว · ทุก test มี beforeEach reset state · fixtures สำหรับ auth · trace mode ตอน retry เพื่อ debug06AI Testing Tools · Comparison 2025
8 tools compared · features · pricing · best fit for ConstructQ
🤖
Playwright + Claude Code + Playwright MCP
Playwright + Anthropic Claude via MCP · AI-generated test cases + self-healing
- ✓ Open source Playwright ฟรี
- ✓ Claude generate test cases จาก markdown scenarios
- ✓ Playwright MCP · AI ควบคุม browser + inspect DOM
- ✓ Self-healing selectors จาก AI
- ✓ ยืดหยุ่นสุด · integrate CI/CD ได้
- × ต้องเซ็ตอัพเอง · ไม่มี GUI dashboard
🎯
Cursor + Playwright
Cursor IDE + Claude/GPT · AI IDE that writes Playwright tests
- ✓ AI auto-complete Playwright test code
- ✓ Chat กับ codebase context
- ✓ ทำ Composer ให้ AI generate ทั้ง file
- ✓ Debug + refactor ด้วย AI
- × จ่ายรายเดือน $20/user
- × Learning curve · ต้อง prompt เก่ง
🧠
Testim.io (Tricentis)
AI-powered test authoring · record/playback + self-healing locators
- ✓ AI smart locators · self-heal เมื่อ UI เปลี่ยน
- ✓ Record + playback ง่าย
- ✓ CI/CD integration ครบ
- × จ่ายรายปี · Enterprise pricing
- × Lock-in · ยาก migrate ออก
👁️
Mabl
Low-code AI test automation · visual + functional testing
- ✓ ML-powered auto-heal
- ✓ Visual regression AI · pixel-perfect
- ✓ Cloud-based · เร็ว
- ✓ Cross-browser + mobile
- × จ่ายรายเดือนสูง
- × Locked to platform · ไม่ export code
🎨
Applitools Eyes
Visual AI testing · integrate กับ Playwright/Cypress
- ✓ Visual AI · เห็นการเปลี่ยนแปลง UI
- ✓ Cross-browser screenshot compare
- ✓ Integrate Playwright/Cypress ได้เลย
- × เฉพาะ visual · ไม่ทำ functional
- × ต้องใช้ร่วมกับ Playwright
🐺
QA Wolf
AI-assisted test creation + QA-as-a-Service model
- ✓ Human + AI hybrid
- ✓ ครบวงจร · จ้าง QA team + AI
- ✓ 24/7 test runs · 4-hour bug fix guarantee
- × ราคาแพงมาก · $10K+/month
- × Vendor dependency
💫
Reflect.run
No-code AI browser testing · record real user flows
- ✓ No-code · ไม่ต้องเขียนโค้ด
- ✓ Visual test builder
- ✓ Cloud-based · จำง่าย
- × ยืดหยุ่นน้อยกว่า code-based
- × จ่ายรายเดือน
📘
Katalon Studio + Copilot
All-in-one test automation platform with AI Copilot
- ✓ Free community edition
- ✓ Support ทุก platform (web/API/mobile)
- ✓ AI Copilot สำหรับ test generation
- × UI ไม่ modern เท่า
- × Learning curve
📊 Comparison Matrix
| Tool | Code-based | No-code | Self-heal | Visual AI | Free tier | CI/CD | Thai UI | Best for |
|---|---|---|---|---|---|---|---|---|
| Playwright + Claude MCP | ✅ | ❌ | ⚠️ AI-assist | ❌ | ✅ | ✅ | ✅ | ConstructQ · flexible |
| Cursor + Playwright | ✅ | ❌ | ⚠️ | ❌ | ❌ | ✅ | ✅ | Dev-heavy teams |
| Testim.io | ⚠️ | ✅ | ✅ | ❌ | ❌ | ✅ | ⚠️ | Non-dev QA teams |
| Mabl | ❌ | ✅ | ✅ | ✅ | ⚠️ trial | ✅ | ⚠️ | Visual regression |
| Applitools | ⚠️ addon | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | Visual test add-on |
| QA Wolf | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | ⚠️ | Outsourced QA |
| Reflect.run | ❌ | ✅ | ✅ | ⚠️ | ✅ | ✅ | ⚠️ | Non-technical |
| Katalon Copilot | ✅ | ⚠️ | ⚠️ | ❌ | ✅ | ✅ | ⚠️ | All-platform |
07Recommendation for ConstructQ
Best combination for Thai construction QC SaaS
🏆
Top Recommendation: Playwright + Cursor IDE + Playwright MCP (Claude) + Applitools Eyes (สำหรับ visual regression) · รวมกันได้ automation ครบวงจร + AI-assisted + visual AI · budget ประหยัด + ยืดหยุ่นสูง
💡 ทำไมเลือกชุดนี้?
- Playwright เป็น open-source · ฟรี · maintain โดย Microsoft · community ใหญ่ · เร็วที่สุดใน 2025
- Cursor IDE ให้ AI ช่วยเขียนโค้ด · Composer generate ทั้ง test file ได้ · ประหยัดเวลา 60-70%
- Playwright MCP (Claude) · AI ควบคุม browser ได้ · generate test จาก scenario ภาษาไทย
- Applitools สำหรับ visual regression · จับ UI bug ที่ Playwright plain ไม่เห็น (color · alignment)
- Total cost: Playwright ฟรี + Cursor $20 + Claude $20 + Applitools $200/mo = ~$240/mo · เทียบกับ Testim/Mabl หลักหมื่น
🚀 Suggested Implementation Roadmap
- Week 1-2 · Setup: Playwright + Cursor + Claude Code · Config CI (GitHub Actions)
- Week 3-4 · Foundation: Page Object Model · Auth fixture · CreateProject POM · run P1 tests
- Week 5-6 · Coverage: เพิ่ม test P2 · integrate Applitools · visual baselines
- Week 7-8 · CI/CD: Parallel runs · report portal · Slack notifications
- Ongoing: AI generate test จาก scenarios · Claude MCP for exploratory testing · Weekly report
🎓 Skills to Build
- TypeScript · basic to intermediate · type safety สำคัญ
- Playwright API · locators · assertions · fixtures · POM pattern
- Claude/AI Prompting · เขียน prompt ให้ AI generate test cases ที่ดี
- Git + GitHub Actions · workflow · secrets · caching
- Test data management · Faker · seed factories
⚠️
Common Pitfalls to avoid:
- อย่าใช้ AI generate 100% · human review เสมอ (30% ของ AI test มี bug)
- อย่าเขียน selector ตายตัว (class name / xpath) · ใช้ role + label
- อย่าให้ test dependency ระหว่างกัน · แต่ละ test ต้อง independent
- อย่า commit .env credentials · ใช้ GitHub Secrets
- อย่า flaky ignore · แก้ทันที · flaky test = confidence ต่ำลง
08Appendix
📌 Version History
- ConstructQ_CreateProject_v14.0.html · 30 มิ.ย. 2569 · Confirm popup added
- เอกสารนี้ v1.0 · 9 ก.ค. 2569 · Initial release · 57 test cases + Playwright + AI tools
🔗 References
- Playwright Docs:
https://playwright.dev - Playwright MCP:
https://github.com/microsoft/playwright-mcp - Cursor IDE:
https://cursor.com - Anthropic Claude:
https://claude.ai - Applitools Eyes:
https://applitools.com - WCAG 2.1 AA:
https://www.w3.org/WAI/WCAG21/quickref
📊 Excel Companion
ดูไฟล์ ConstructQ_CreateProject_TestScenario_v1.0.xlsx คู่กัน · มี 4 sheets:
- Summary: Test overview + statistics
- Test Scenarios: 12 test areas overview
- Test Cases: 57 detailed cases (TC ID · Scenario · Steps · Expected · Priority · Type · Status)
- Playwright Coverage: test cases mapped กับ Playwright test files